package com.multitrack.map.datatype;

import java.util.ArrayList;

import android.content.Context;
import android.graphics.drawable.Drawable;
import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.OverlayItem;

public class ItemizedOverlays extends ItemizedOverlay<OverlayItem>{
	
	private ArrayList<OverlayItem> mOverlays;
	private Context mContext;
	private OverlayItem item;
	
	public ItemizedOverlays(Drawable marker) {
		super(boundCenterBottom(marker));
		mOverlays = new ArrayList<OverlayItem>();
		populate();
	}
	
	public ItemizedOverlays(Drawable marker, Context context) {
		super(boundCenterBottom(marker));
		mOverlays = new ArrayList<OverlayItem>();
		this.mContext = context;
		populate();
	}

	@Override
	protected OverlayItem createItem(int position) {
		return mOverlays.get(position);		
	}

	@Override
	public int size() {
		return mOverlays.size();
	}
		
	
	public void add(OverlayItem item) {
		mOverlays.add(item);
		populate();
	}
	
	public void remove(OverlayItem item) {
		mOverlays.remove(item);
		populate();
	}

}
